////////////////////////////////////////////////////
//
//  io1.c
//  implementation of io device for OS simulation.
//
//  author: Phillip Cardon
//
////////////////////////////////////////////////////

#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>

void *runIO(void *signal, semaphore *the_sem, int *data)
{
	int interrupt_time = 0;
	//place io data in memory
	printf ("from io device: ");
	printf (&data)
	//generate time until interrupt
	interrupt_time = rand() % 10 + 1;
	//create timespec struct for sleeping
	struct timespec interval = {interrupt_time , 0};
	//sleep
	nanosleep(&interval, NULL);
	//fire interrupt
	thread_cond_signal(the_sem);
    printf("I/O device (video) generated an interrupt!");
}